import { baseRequest } from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/tjzy/file/` + url, ...arg)
export default {
	upload(data) {
		return request('upload', data, 'post')
	},
	uploadNoTimeSuffix(data) {
		return request('uploadNoTimeSuffix', data, 'post')
	},
	downloadWithBucket(bucketName, fileName) {
		return request('downloadWithBucket/' + bucketName + '?fileName=' + fileName, null, 'get', {
			responseType: 'blob'
		})
	},
	download(fileName) {
		return request('download/' + fileName, '', 'get', {
			responseType: 'blob'
		})
	}
}
